<?php


namespace app\api\validate;


use think\Validate;

class ShopValidate extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'state' => ['require','in:0,1,2'],
        'shopname' => ['require'],
        'name' => ['require'],
        'number' => ['require'],
        'mobile' => ['require'],
        'image' => ['require'],
        'trademark' => ['require'],
        'wechat' => ['require'],
        'avatar' => ['require'],
        'bio' => ['require'],
        'content' => ['require'],
        'city' => ['require'],
        'certificate' => ['require'],
        'show_id' => ['require'],
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'apply'  => ['state','shopname','name','number','image','wechat','certificate'],
        'applyShopShowLocation'  => ['show_id','certificate'],
    ];


    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'state' => '店铺类型',
            'shopname' => '店铺名称',
            'name' => '企业名/姓名',
            'number' => '统一信用/身份证号',
            'mobile' => '手机号',
            'image' => '证件图片',
            'trademark' => '商标证书',
            'wechat' => '微信号',
            'avatar' => '店铺头像',
            'bio' => '店铺简介',
            'content' => '店铺介绍',
            'city' => '省市',
            'certificate' => '转账证明',
            'show_id' => '展示位ID',
        ];
        parent::__construct($rules, $message, $field);
    }

}